import { createRouter, createWebHistory } from 'vue-router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import(/* webpackChunkName: "about" */ '../views/flowable/Main.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/about/About.vue')
  },
  {
    path: '/elasticsearch-main',
    name: 'elasticsearchMain',
    component: () => import(/* webpackChunkName: "about" */ '../views/elasticsearch/Main')
  },
  {
    path: '/neo4j-main',
    name: 'neo4jMain',
    component: () => import(/* webpackChunkName: "about" */ '../views/neo4j/Neo4j')
  },
  {
    path: '/Flowable-Main',
    name: 'FlowableMain',
    component: () => import(/* webpackChunkName: "about" */ '../views/flowable/Main.vue')
  },
  {
    path: '/bimface-Main',
    name: 'BimfaceMain',
    component: () => import(/* webpackChunkName: "about" */ '../views/bimface/Main.vue')
  },
  {
    path: '/Flowable-User',
    name: 'FlowableUser',
    component: () => import(/* webpackChunkName: "about" */ '../views/flowable/User.vue')
  },
  {
    path: '/Threes-Main',
    name: 'ThreesMain',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/threes/Main.vue')
  },
  {
    path: '/Threes-Cube',
    name: 'ThreesCube',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/threes/Cube.vue')
  },
  {
    path: '/Threes-WebglPoints',
    name: 'ThreesWebglPoints',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/threes/WebglPoints')
  },
  {
    path: '/Threes-WebglPoints2',
    name: 'ThreesWebglPoints2',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/threes/WebglPoints2')
  },
  {
    path: '/Threes-WebglPoints3',
    name: 'ThreesWebglPoints3',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/threes/WebglPoints3')
  },
  {
    path: '/Threes-SvgRenderer',
    name: 'ThreesSvgRenderer',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/threes/SvgRender')
  },
  {
    path: '/program',
    name: 'program',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/program/Program')
  },
  {
    path: '/d3graph',
    name: 'd3graph',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/neo4j/D3Graph')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
})
router.afterEach(() => {
  NProgress.done();
})

export default router
